package collection_250224;

import java.util.*;

public class set2 {

    public static void main(String[] args) {
//        TreeSet<String> s1 = new TreeSet<>();
//        s1.add("d");
//        s1.add("a");
//        s1.add("b");
//        s1.add("c");
//        System.out.println(s1.size());
//        System.out.println(s1.first());
//        System.out.println(s1.last());
//        System.out.println(s1.pollFirst());
//        System.out.println(s1.size());
//
//        LinkedHashSet<String> s2 = new LinkedHashSet<>();
//
//        HashMap<String,Object> m1 = new HashMap<>();
//        m1.get("a");

        TreeMap<String,Object> m2 = new TreeMap<>();
        m2.put("d","d");

        m2.put("a","b");
        m2.put("b","c");
        String key = m2.firstKey();
        System.out.println(key);
        Object o = m2.get(key);
        System.out.println(o);
        System.out.println(m2.size());
        Map.Entry<String, Object> stringObjectEntry = m2.pollFirstEntry();
        System.out.println(stringObjectEntry);
        System.out.println(m2.size());

    }
}
